home *** CD-ROM | disk | FTP | other *** search
- Path: crc-news.doc.ca!usenet
- From: Slobodan Celenkovic <Celenkovic.Bob@ic.gc.ca>
- Newsgroups: comp.lang.c++
- Subject: Re: Advanced C++ question...
- Date: 27 Mar 1996 21:39:57 GMT
- Organization: Industry Canada
- Message-ID: <4jccjd$2k9@crc-news.doc.ca>
- References: <4iprfg$1ui@aadt> <4iv31k$ch7@transformer.pti-us.com>
- NNTP-Posting-Host: bouhadrah.mohamed.bsd001.ic.gc.ca
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; U; 16bit)
-
- Walt Dixon <wv.dixon@pti-us.com> wrote:
- >You might try something like this
- >
- >object& operator*(int);
- >object& operator*(int) const;
- >
- >the first being the lvalue operator, the second
- >being the rvalue operator
- >
- >
- >walt
- >
-
- Actually:
-
- lval or rval => object& operator*(int);
- rval only => object operator*(int) const;
-
- The 1st one returns reference so it can be used as either lval or rval,
- whereas the 2nd one returns the object so it can be only used as rval. I
- am not 100% sure though.
-
-
-